package com.yowasa.xiuxian.engine.travel.adventure;

import com.google.common.collect.Sets;
import com.yowasa.xiuxian.engine.CommonEngine;
import com.yowasa.xiuxian.engine.item.ItemInterface;
import com.yowasa.xiuxian.engine.travel.AdventureInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.MapEnum;
import com.yowasa.xiuxian.entity.enums.QualityEnum;
import com.yowasa.xiuxian.entity.enums.RefreshType;
import com.yowasa.xiuxian.entity.po.XiuxianTransactPO;
import com.yowasa.xiuxian.mapper.XiuxianTransactMapper;
import com.yowasa.xiuxian.service.helper.ItemHelper;
import com.yowasa.xiuxian.service.helper.ResourceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Set;

/**
 * 金陵大厨 一次刷新仅能被触发一次
 * 上架一个鲜香锅巴
 */
@Component
public class XueLuoRenJianADV implements AdventureInterface {


    @Autowired
    private ResourceHelper resourceHelper;
    @Autowired
    private ItemHelper itemHelper;

    @Override
    public Set<MapEnum> limitMaps() {
        //璃月港
        return Sets.newHashSet(MapEnum.LI_YUE_GANG);
    }

    public boolean limitCheck(UserBO user) {
        return resourceHelper.checkHaveResource(user.getGuildId(), this.getClass().getName(), RefreshType.LOCK_TIME);
    }

    @Override
    public String exec(UserBO user) {
        resourceHelper.lockResource(user.getGuildId(), this.getClass().getName(), 10 * 360);
        itemHelper.addItem(user, "雪落人间诀秘籍", 1);
        String msg = "阅尽璃月繁华，你提笔写了一本璃月游记，被万文书集的老板娘看中，她从书架后面拿出一本秘籍交给你，作为你的璃月游记的稿费\n" +
                "获得了战技[雪落人间诀]的秘籍";
        return msg;
    }

}
